package io.intodrea.xml.dto;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import java.util.List;

/**
 * @author Jwenk
 * @description
 * @copyright intoDream.io 筑梦科技
 * @email xmsjgzs@163.com
 * @date 2018-07-24,下午10:56
 */
@JacksonXmlRootElement(localName = "student")
public class Student<T> extends Base{

    @JacksonXmlProperty(localName = "studentName")
    private String name;

    @JacksonXmlProperty(localName = "nainling")
    private Integer age;

    @JacksonXmlProperty(localName = "dh")
    private String phone;

    @JacksonXmlProperty(localName = "array")
    @JacksonXmlElementWrapper(localName = "rs")
    private List<T> grades;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public List<T> getGrades() {
        return grades;
    }

    public void setGrades(List<T> grades) {
        this.grades = grades;
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
